package csc.daonjpa.java.domain;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;

/**
 * Entity class for Account table. This is a simple POJO class with annotations to define mapping with DB table
 * @author nvu3
 *
 */
@Entity
public class Customer implements Serializable {
	private static final long serialVersionUID = 1L;
	
	// accountNumber field maps with accountNumber column in Account table
	// @Id indicates that accountNumber is the primary key for Account table
	@Id
	@Column(name = "loginId")
	private String loginId;
	
	@Column(name = "password")
	private String password;
	
	@Column(name = "firstname")
	private String firstname;
	
	@Column(name = "lastname")
	private String lastname;
	
	@Column(name = "address")
	private String address;
	
	@Column(name = "phone")
	private String phone;
	
	@OneToMany
	private List<Account> accounts;
	
	@OneToMany
	private List<Card> cards;
	
	@OneToMany
	private List<CustomerRole> roles;
	
	@OneToMany
	private List<Inbox> inboxs;

	/**
	 * Required constructor
	 */
	public Customer() {
	
	}

	public Customer(String loginId, String password, String firstname,
			String lastname, String address, String phone,
			List<Account> accounts, List<Card> cards, List<CustomerRole> roles) {
		super();
		this.loginId = loginId;
		this.password = password;
		this.firstname = firstname;
		this.lastname = lastname;
		this.address = address;
		this.phone = phone;
		this.accounts = accounts;
		this.cards = cards;
		this.roles = roles;
	}


	public String getLoginId() {
		return loginId;
	}

	public void setLoginId(String loginId) {
		this.loginId = loginId;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getFirstname() {
		return firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public String getLastname() {
		return lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	
	
}